/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React from 'react';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import StackViewStyleInterpolator from 'react-navigation-stack/src/views/StackView/StackViewStyleInterpolator';

import Login from './pages/Login';
import Main from './pages/Main';
import Asset from './pages/Asset';
import AssetDetail from './pages/AssetDetail';
import AssetInitDetail from './pages/AssetInitDetail';
import Inventory from './pages/Inventory';
import QBarCodeScan from './component/QBarCodeScan';
import QBarCodeScanWhite from './component/QBarCodeScanWhite';
import AddMove from './pages/AddMove';
import LocationChange from './pages/LocationChange';
import InstallEquipment from './pages/InstallEquipment'
import InventoryDetail from './pages/InventoryDetail';
import ViewInventoryDetail from './pages/ViewInventoryDetail';
import AddInventory from './pages/AddInventory';
import IpSetting from './pages/IpSetting';
import AssetPay from './pages/AssetPay';
import DataSync from './pages/DataSync';
import {setJSExceptionHandler, getJSExceptionHandler, setNativeExceptionHandler } from 'react-native-exception-handler';
import Statistics from './pages/Statistics';
import Test from './RfidDemo';
import QBarCodeTest from './QBarCodeTest';


const AppNavigator = createStackNavigator({
  Login: {
    screen: Login,
  },
  Main: {
    screen: Main,
  },
  Asset: {
    screen: Asset,
  },
  AssetDetail: {
    screen: AssetDetail,
  },
  ViewInventoryDetail:{
    screen: ViewInventoryDetail,
  },
  AssetInitDetail: {
    screen: AssetInitDetail,
  },
  Inventory: {
    screen: Inventory,
  },
  QBarCodeScan: {
    screen: QBarCodeScan,
  },
  QBarCodeScanWhite: {
    screen: QBarCodeScanWhite,
  },
  AddMove: {
    screen: AddMove,
  },
  LocationChange:{
    screen: LocationChange,
  },
  InstallEquipment: {
    screen: InstallEquipment,
  },
  AssetPay:{
    screen:AssetPay,
  },
  InventoryDetail: {
    screen: InventoryDetail,
  },
  AddInventory: {
    screen: AddInventory,
  },
  IpSetting: {
    screen: IpSetting,
  },
  Statistics: {
    screen: Statistics,
  },
  Test: {
    screen: Test,
  },
  DataSync:{
    screen: DataSync,
  }
},
{
  initialRouteName: 'Login',
  headerMode: 'none',
  transitionConfig:()=>({
    screenInterpolator: StackViewStyleInterpolator.forInitial,
  })
});

setJSExceptionHandler((error, isFatal)=>{
  
  //Alert.alert(error.name,error.message,[{text: 'OK'}])
}, true)

setNativeExceptionHandler(exceptionString => {
  //Alert.alert('error',exceptionString,[{text: 'OK'}])
});


export default createAppContainer(AppNavigator);
